package com.hahaliu.hahaliu.controller.user;

import com.hahaliu.hahaliu.common.result.Result;
import com.hahaliu.hahaliu.pojo.vo.CategoryVO;
import com.hahaliu.hahaliu.service.category.CategoryService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/user/category")
@Api(tags = "用户端分区相关接口")
@Slf4j
public class CategoryController {
	@Autowired
	private CategoryService categoryService;
//
//	@GetMapping("/getall")
//	@ApiOperation("获取所有分区")
//	public Result<List<Category>> getAll() {
//		List<Category> list = categoryService.list();
//		return Result.success(list);
//	}
//
//	@GetMapping("/{mcId}")
//	@ApiOperation("查询对应分区信息")
//	public Result<Category> getCategoryById(@PathVariable Integer mcId) {
//		Category category = categoryService.getById(mcId);
//		return Result.success(category);
//	}

	/**
	 * 获取全部分区接口
	 * @return CustomResponse对象
	 */
	@GetMapping("/get-all")
	@ApiOperation("获取所有分区")
	public Result<List<CategoryVO>> getAll() {
		return Result.success(categoryService.getAll());
	}



}
